package com.company.cloud.club.modules.db.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.company.cloud.club.modules.db.domain.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Select("SELECT * FROM cust_user_info " +
            "WHERE nick_name LIKE CONCAT('%', #{condition,jdbcType=VARCHAR}, '%') " +
            "OR mobile LIKE CONCAT('%', #{condition,jdbcType=VARCHAR}, '%') " +
            "OR real_name LIKE CONCAT('%', #{condition,jdbcType=VARCHAR}, '%') " +
            "and user_state=1 and user_type_one=2 ORDER BY cdt DESC;")
    List<UserInfo> selectUserByCondition(@Param("condition") String condition);

    @Select("SELECT * FROM cust_user_info where user_state=1 and user_type_one=2 ORDER BY cdt DESC limit 0,50")
    List<UserInfo> selectLists();
}